﻿
/*----------------------------------------------------------------//
// 文件名：MoTestRecord.cs
// 文件功能描述：实体 MoTestRecord.
// 
// 创建标识：2009-03-10
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTestRecord
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTestRecord
	/// </summary>
	public partial class MoTestRecord:ICloneable
	{
		#region 表TestRecord的字段
		private string _tr_id;
		private string _co_item_id;
		private string _ref_ft_id;
		private string _tr_url;
		private string _report_slice_url;
		#endregion
		
		#region 构造函数
		public MoTestRecord()
		{
		    
		    
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTestRecord(MoTestRecord item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTestRecord(string tr_id,string co_item_id,string ref_ft_id,string tr_url,string report_slice_url)
		{
		this._tr_id=tr_id;
		this._co_item_id=co_item_id;
		this._ref_ft_id=ref_ft_id;
		this._tr_url=tr_url;
		this._report_slice_url=report_slice_url;
		}
		#endregion
		
		#region 表TestRecord的字段属性
		/// <summary>
		/// TR_ID
		/// </summary>
		public string Tr_Id
		{
			get {return _tr_id;}
			set {_tr_id=value;}
		}
		/// <summary>
		/// CO_ITEM_ID
		/// </summary>
		public string Co_Item_Id
		{
			get {return _co_item_id;}
			set {_co_item_id=value;}
		}
		/// <summary>
		/// REF_FT_ID
		/// </summary>
		public string Ref_Ft_Id
		{
			get {return _ref_ft_id;}
			set {_ref_ft_id=value;}
		}
		/// <summary>
        /// 原始记录文件记录ID(即TFiles表中的File_ID)
		/// </summary>
		public string Tr_Url
		{
			get {return _tr_url;}
			set {_tr_url=value;}
		}
		/// <summary>
        /// 报告片段文件记录ID(即TFiles表中的File_ID)
		/// </summary>
		public string Report_Slice_Url
		{
			get {return _report_slice_url;}
			set {_report_slice_url=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTestRecord CopyTo(MoTestRecord item)
        {
		    item.Tr_Id=this.Tr_Id;
		    item.Co_Item_Id=this.Co_Item_Id;
		    item.Ref_Ft_Id=this.Ref_Ft_Id;
		    item.Tr_Url=this.Tr_Url;
		    item.Report_Slice_Url=this.Report_Slice_Url;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTestRecord NewTestRecord=new MoTestRecord();
		    NewTestRecord._tr_id=this._tr_id;
		    NewTestRecord._co_item_id=this._co_item_id;
		    NewTestRecord._ref_ft_id=this._ref_ft_id;
		    NewTestRecord._tr_url=this._tr_url;
		    NewTestRecord._report_slice_url=this._report_slice_url;
			return NewTestRecord;
		}
		
		private static MoTestRecord _empty = new MoTestRecord(string.Empty,string.Empty,string.Empty,string.Empty,string.Empty);
        public static MoTestRecord Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoTestRecord NewTestRecord = obj as MoTestRecord;
                if (NewTestRecord == null)
                {
                    return false;
                }
                else
                {
				if (NewTestRecord.Tr_Id==this.Tr_Id && NewTestRecord.Co_Item_Id==this.Co_Item_Id && NewTestRecord.Ref_Ft_Id==this.Ref_Ft_Id && NewTestRecord.Tr_Url==this.Tr_Url && NewTestRecord.Report_Slice_Url==this.Report_Slice_Url)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Tr_Id={0}/Co_Item_Id={1}/Ref_Ft_Id={2}/Tr_Url={3}/Report_Slice_Url={4}",_tr_id,_co_item_id,_ref_ft_id,_tr_url,_report_slice_url);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["TR_ID"]!=null && row["TR_ID"]!=DBNull.Value)
			{
			    this.Tr_Id = (string)row["TR_ID"];
			}
			else
			{
				this.Tr_Id =string.Empty;
			}
		    if(row["Co_Item_ID"]!=null && row["Co_Item_ID"]!=DBNull.Value)
			{
			    this.Co_Item_Id = (string)row["Co_Item_ID"];
			}
			else
			{
				this.Co_Item_Id =string.Empty;
			}
		    if(row["REF_FT_ID"]!=null && row["REF_FT_ID"]!=DBNull.Value)
			{
			    this.Ref_Ft_Id = (string)row["REF_FT_ID"];
			}
			else
			{
				this.Ref_Ft_Id =string.Empty;
			}
		    if(row["TR_URL"]!=null && row["TR_URL"]!=DBNull.Value)
			{
			    this.Tr_Url = (string)row["TR_URL"];
			}
			else
			{
				this.Tr_Url =string.Empty;
			}
		    if(row["Report_Slice_URL"]!=null && row["Report_Slice_URL"]!=DBNull.Value)
			{
			    this.Report_Slice_Url = (string)row["Report_Slice_URL"];
			}
			else
			{
				this.Report_Slice_Url =string.Empty;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["TR_ID"] = this.Tr_Id;
			row["Co_Item_ID"] = this.Co_Item_Id;
			row["REF_FT_ID"] = this.Ref_Ft_Id;
			row["TR_URL"] = this.Tr_Url;
			row["Report_Slice_URL"] = this.Report_Slice_Url;
		}
		#endregion
	}
}
#endregion
